﻿using System;

namespace KM.Framework.Business
{
    public abstract partial class ObjectSetViewModel<T>
    {
        /// <summary>
        /// 选中鼠标右键
        /// </summary>
        private object _CurrentObjectMenu;
        public object CurrentObjectMenu
        {
            get
            {
                return _CurrentObjectMenu;
            }
            set
            {
                _CurrentObjectMenu = value;
                this.CurrentObject = (T)value;
            }
        }

        /// <summary>
        /// 当前是否能打开右键菜单
        /// 绑定到右键菜单上,在打开编辑弹窗时设为false,关闭编辑弹窗时设为true,
        /// 以防止出现'左右键快速连击'所形成的双击事件和右键菜单同时响应,右键菜单和编辑弹窗同时出现的情形
        /// </summary>
        private bool _IsCanOpenContextMenu = true;      //默认设为true
        public bool IsCanOpenContextMenu
        {
            get { return _IsCanOpenContextMenu; }
            set
            {
                if (_IsCanOpenContextMenu != value)
                {
                    _IsCanOpenContextMenu = value;
                    RaisePropertyChanged("IsCanOpenContextMenu");
                }
            }
        }
    }
}
